import { atom } from "recoil";

interface AtomsRootProps {
  username: string;
  shoppingCart: {
    items: Array<{ id: number; name: string }>;
  };
}

export const defaultAtomsRoot = atom<AtomsRootProps>({
  key: "root",
  default: {
    username: "dva",
    shoppingCart: {
      items: [],
    },
  },
});

interface RoboteListProps {
  error: string | null;
  loading: boolean;
  robote: Array<any>
}

export const roboteList = atom<RoboteListProps>({
  key: "roboteList",
  default: {
    error: null,
    loading: true,
    robote: []
  }
})
